home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / src-16f.lha / compiler / mips / pred.lisp < prev    next >
Encoding:
Text File  |  1991-11-06  |  1.6 KB  |  64 lines

  1. ;;; -*- Package: C; Log: C.Log -*-
  2. ;;;
  3. ;;; **********************************************************************
  4. ;;; This code was written as part of the CMU Common Lisp project at
  5. ;;; Carnegie Mellon University, and has been placed in the public domain.
  6. ;;; If you want to use this code or any part of CMU Common Lisp, please contact
  7. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
  8. ;;;
  9. (ext:file-comment
  10.   "$Header: pred.lisp,v 1.6 91/02/20 15:15:00 ram Exp $")
  11. ;;;
  12. ;;; **********************************************************************
  13. ;;;
  14. ;;; $Header: pred.lisp,v 1.6 91/02/20 15:15:00 ram Exp $
  15. ;;;
  16. ;;;    This file contains the VM definition of predicate VOPs for the MIPS.
  17. ;;;
  18. ;;; Written by Rob MacLachlan
  19. ;;;
  20. ;;; Converted by William Lott.
  21. ;;; 
  22.  
  23. (in-package "MIPS")
  24.  
  25.  
  26. ;;;; The Branch VOP.
  27.  
  28. ;;; The unconditional branch, emitted when we can't drop through to the desired
  29. ;;; destination.  Dest is the continuation we transfer control to.
  30. ;;;
  31. (define-vop (branch)
  32.   (:info dest)
  33.   (:generator 5
  34.     (inst b dest)
  35.     (inst nop)))
  36.  
  37.  
  38. ;;;; Conditional VOPs:
  39.  
  40. ;if-true (???), if-eql, ...
  41.  
  42. (define-vop (if-eq)
  43.   (:args (x :scs (any-reg descriptor-reg zero null))
  44.      (y :scs (any-reg descriptor-reg zero null)))
  45.   (:conditional)
  46.   (:info target not-p)
  47.   (:policy :fast-safe)
  48.   (:translate eq)
  49.   (:generator 3
  50.     (let ((x-prime (sc-case x
  51.              ((any-reg descriptor-reg) x)
  52.              (zero zero-tn)
  53.              (null null-tn)))
  54.       (y-prime (sc-case y
  55.              ((any-reg descriptor-reg) y)
  56.              (zero zero-tn)
  57.              (null null-tn))))
  58.       (if not-p
  59.       (inst bne x-prime y-prime target)
  60.       (inst beq x-prime y-prime target)))
  61.     (inst nop)))
  62.  
  63.  
  64.